package com.ftg.learn.framework.spring.chapter04.local.javabase;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 配置类
 *  @Configuration 注解,把当前类作为配置文件类来使用
 *  @Bean联用
 * @author 布衣
 */
@Configuration
public class Configer {

    @Bean("createLion")
    public Lion createLion(){
        Lion l1 = new Lion();
        l1.setName("l1");
        l1.setColor("red");
        l1.setAge("10");
        return l1;
    }

    @Bean("createLion1")
    public Lion createLion1(){
        return new Lion();
    }

    @Bean
    public Lion createLion2(){
        return new Lion();
    }

}
